@model DeathReportManagement.Models.DeathReport
@{
    ViewData["Title"] = "打印死亡报告";
    Layout = null;
}

<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>@ViewData["Title"]</title>
    <link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
    <link rel="stylesheet" href="~/css/print.css" />
    <style>
        body { font-family: "SimSun", serif; }
        .no-print { display: block; }
        .print-only { display: none; }
        
        @@media print {
            .no-print { display: none !important; }
            .print-only { display: block !important; }
        }
    </style>
</head>
<body>
    <div class="container-fluid">
        <!-- 打印按钮 -->
        <div class="no-print mb-3">
            <button onclick="window.print()" class="btn btn-primary">打印报告</button>
            <a href="javascript:history.back()" class="btn btn-secondary">返回</a>
        </div>
        
        <!-- 报告头部 -->
        <div class="report-header">
            <div class="report-title">死亡医学证明书</div>
            <div class="report-subtitle">MEDICAL CERTIFICATE OF DEATH</div>
            <div style="margin-top: 10pt;">
                <strong>报告编号：@Model.ReportNo</strong>
            </div>
        </div>
        
        <!-- 基础信息 -->
        <div class="form-section">
            <h5>一、基础信息</h5>
            <div class="row">
                <div class="col-md-4">
                    <label class="form-label">门诊号</label>
                    <div class="form-value">@(Model.OutpatientNo ?? "")</div>
                </div>
                <div class="col-md-4">
                    <label class="form-label">住院号</label>
                    <div class="form-value">@(Model.InpatientNo ?? "")</div>
                </div>
                <div class="col-md-4">
                    <label class="form-label">住院次数</label>
                    <div class="form-value">@(Model.HospitalizationCount?.ToString() ?? "")</div>
                </div>
            </div>
        </div>
        
        <!-- 死者信息 -->
        <div class="form-section">
            <h5>二、死者基本信息</h5>
            <div class="row">
                <div class="col-md-4">
                    <label class="form-label">姓名</label>
                    <div class="form-value">@Model.DeceasedName</div>
                </div>
                <div class="col-md-2">
                    <label class="form-label">性别</label>
                    <div class="form-value">@Model.Gender</div>
                </div>
                <div class="col-md-3">
                    <label class="form-label">年龄</label>
                    <div class="form-value">@Model.Age @Model.AgeUnit</div>
                </div>
                <div class="col-md-3">
                    <label class="form-label">民族</label>
                    <div class="form-value">@Model.Ethnicity</div>
                </div>
            </div>
            
            <div class="row">
                <div class="col-md-3">
                    <label class="form-label">证件类型</label>
                    <div class="form-value">@Model.IdType</div>
                </div>
                <div class="col-md-6">
                    <label class="form-label">证件号码</label>
                    <div class="form-value">@Model.IdNumber</div>
                </div>
                <div class="col-md-3">
                    <label class="form-label">出生日期</label>
                    <div class="form-value">@Model.BirthDate.ToString("yyyy-MM-dd")</div>
                </div>
            </div>
            
            <div class="row">
                <div class="col-md-3">
                    <label class="form-label">婚姻状况</label>
                    <div class="form-value">@Model.MaritalStatus</div>
                </div>
                <div class="col-md-3">
                    <label class="form-label">文化程度</label>
                    <div class="form-value">@Model.Education</div>
                </div>
                <div class="col-md-3">
                    <label class="form-label">个人身份</label>
                    <div class="form-value">@Model.PersonalIdentity</div>
                </div>
                <div class="col-md-3">
                    <label class="form-label">是否无名氏</label>
                    <div class="form-value">@(Model.IsAnonymous ? "是" : "否")</div>
                </div>
            </div>
            
            <div class="row">
                <div class="col-md-12">
                    <label class="form-label">生前工作单位</label>
                    <div class="form-value">@Model.WorkUnit</div>
                </div>
            </div>
        </div>
        
        <!-- 死亡信息 -->
        <div class="form-section">
            <h5>三、死亡信息</h5>
            <div class="row">
                <div class="col-md-6">
                    <label class="form-label">死亡日期时间</label>
                    <div class="form-value">@Model.DeathDateTime.ToString("yyyy年MM月dd日 HH时mm分")</div>
                </div>
                <div class="col-md-6">
                    <label class="form-label">死亡地点</label>
                    <div class="form-value">@Model.DeathLocation</div>
                </div>
            </div>
            
            <div class="row">
                <div class="col-md-12">
                    <label class="form-label">死亡时是否处于妊娠期或妊娠终止后42天内</label>
                    <div class="form-value">@(Model.IsPregnant ? "是" : "否")</div>
                </div>
            </div>
        </div>
        
        <!-- 地址信息 -->
        <div class="form-section">
            <h5>四、地址信息</h5>
            <div class="row">
                <div class="col-md-3">
                    <label class="form-label">户籍地址类型</label>
                    <div class="form-value">@Model.HouseholdAddressType</div>
                </div>
                <div class="col-md-9">
                    <label class="form-label">户籍详细地址</label>
                    <div class="form-value">@Model.HouseholdDetailAddress</div>
                </div>
            </div>
            
            <div class="row">
                <div class="col-md-3">
                    <label class="form-label">常住地址类型</label>
                    <div class="form-value">@Model.ResidenceAddressType</div>
                </div>
                <div class="col-md-9">
                    <label class="form-label">常住详细地址</label>
                    <div class="form-value">@Model.ResidenceDetailAddress</div>
                </div>
            </div>
        </div>
        
        <!-- 联系人信息 -->
        <div class="form-section">
            <h5>五、联系人信息</h5>
            <div class="row">
                <div class="col-md-4">
                    <label class="form-label">联系人姓名</label>
                    <div class="form-value">@Model.ContactName</div>
                </div>
                <div class="col-md-4">
                    <label class="form-label">联系电话</label>
                    <div class="form-value">@Model.ContactPhone</div>
                </div>
                <div class="col-md-4">
                    <label class="form-label">证件类型</label>
                    <div class="form-value">@Model.ContactIdType</div>
                </div>
            </div>
        </div>
        
        <!-- 签名区域 -->
        <div class="signature-section">
            <div class="row">
                <div class="col-md-6">
                    <div class="signature-block">
                        <div class="signature-line"></div>
                        <div class="signature-label">医师签名</div>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="signature-block">
                        <div class="signature-line"></div>
                        <div class="signature-label">填写日期</div>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- 页脚信息 -->
        <div class="print-only" style="position: fixed; bottom: 1cm; left: 0; right: 0; text-align: center; font-size: 10pt;">
            <div>创建人：@Model.Creator.Name　　创建时间：@Model.CreateTime.ToString("yyyy-MM-dd HH:mm")</div>
            @if (Model.AuditTime.HasValue)
            {
                <div>审核时间：@Model.AuditTime.Value.ToString("yyyy-MM-dd HH:mm")</div>
            }
        </div>
    </div>
    
    <script>
        // 自动打印（可选）
        // window.onload = function() { window.print(); };
    </script>
</body>
</html>